fix(executor-e2e): self-diagnose GitHub issue-filing auth failures#1401
Merged
Merged
Conversation
The harness previously surfaced only an opaque 'HTTP 401/403' when issue filing failed, forcing operators to guess whether the token was revoked, under-permissioned, or pointed at the wrong repo. Now fileFailureIssue logs the resolved target repo up front, and on any 401/403 probes GET /user to emit an actionable diagnosis: - 401 -> token invalid/expired/REVOKED; generate a fresh one - 403 with successful /user -> authenticated as '<login>' but lacks Issues:write on the target repo (or fine-grained resource-owner/repo-access mismatch), including the accepted-permissions header Adds unit coverage for both the 401-revoked and 403-missing-permission paths. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
3c16148 to
7a01610
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
When the deterministic executor-e2e suite fails, it files a GitHub issue. Until now, an auth/permission problem surfaced only as an opaque
HTTP 401/HTTP 403in the ADO log — giving no way to tell whether the token was revoked, under-permissioned, or aimed at the wrong repo. This turned every occurrence into a guessing game.Change
fileFailureIssuenow:GET /userand emits an actionable diagnosis:/user→ authenticated as<login>but lacks Issues:write on the target repo (or, for a fine-grained PAT, a resource-owner / repository-access mismatch), including thex-accepted-github-permissionsheader.The diagnosis is best-effort and never throws; the original error is still rethrown so the
WARNINGkeeps the raw status. Issue filing remains non-fatal.Tests
Adds unit coverage for both the 401-revoked and 403-missing-permission paths. Full
src/executor-e2esuite: 22 passing;tsc --noEmitclean; bundle builds.